<template>
  <van-overlay v-model:show="showLoading"  style="position:absolute;width:100%;height:100%;top:0;z-index:9999;background:#fff">
    <van-loading size="48px" style="margin-top:60%">支付中，请稍等...</van-loading>
  </van-overlay>
</template>

<script>
import { onMounted ,ref} from 'vue'
import { showToast ,overlay} from 'vant'
import api from '../api/index'
import { useRouter, useRoute } from 'vue-router'

export default {
  setup() {
    const router = useRouter()
    const route = useRoute()
    const showLoading =ref(true)
    onMounted(() => {
      // setTimeout(()=>{
        methods.init()
      // },1000)
     
    })
    const methods = {
      init() {
        const params = localStorage.getItem("params")  || ''
        const { outTradeNo = '', amount = '', type = '', operation = '', routeName, code = '', other, advert = '' } = JSON.parse(params) 
              // const route= routeName ==='DJBSM'   ? '/DJBSM' : '/DJBEMT'
              router.push({
                path: routeName,
                query: {
                  outTradeNo,
                  amount,
                  type,
                  advert,
                  operation,
                  code,
                  other,
                }
              })
      },
    }
    return {
      ...methods,
      showLoading
    }
  }
}
</script>

<style lang="scss" scoped>
  
</style>